<%@page import="java.util.Date"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<link href="${pageContext.request.contextPath}/css/org_manager.css"
	rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/add_new_org.css"
	rel="stylesheet" type="text/css" />
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:useBean id="edittingOrg"
	class="team02.server.bean.OrganizationBean" scope="page"></jsp:useBean>
<script>
	function check_selected() {
		var test = document.getElementsByName("selected_id");
		var sizes = test.length;
		for ( var i = 0; i < sizes; i++)
			if (test[i].checked)
				return true;
		alert("一つの団体を選択してください！");
		return false;
	}
</script>
<%
//権限をチェック
if(userBean.getAccessLevel()!=1||request.getMethod()=="GET"){
	response.sendRedirect("404.html");
	return;
}
%>
<c:set value="<%=orgBean.listTrashOrganization()%>" var="listOrg"></c:set>
<div class="menu1"><%@include file="/jsputils/menu.jsp"%>
	<div class = "greeting_message">
		<%@include file="/jsputils/greeting.jsp"%>
	</div>
</div>
<div class="container">
<form action="" method="post" name="form">
	<div class="menu">
		<p class="menu_label">トラッシュ</p>
		<p class="menu_item">
			<button type="submit" formaction="org_edit.t02" onclick="return check_selected()">公開</button>
			<button type="submit" formaction="org_manager.t02">キャンセル</button>

		</p>
	</div>
		<table class="table_content" style="width: 100%">
			<tr>
				<th></th>
				<th>名前</th>
				<th>説明</th>
				<th>アドレス</th>
				<th>登録日</th>
				<th>期限日</th>
				<th>alias</th>
				<th>管理者名</th>
				<th>メール</th>

			</tr>
			<c:forEach var="orgItem" items="${listOrg}">
				<tr>
					<td><input type="radio" name="selected_id"
						value="${orgItem.alias}"></td>
					<td>${orgItem.name}</td>
					<td>${orgItem.description}</td>
					<td>${orgItem.address}</td>
					
					<td>${orgItem.getRegisteredDateString()}</td>
					<td>${orgItem.getExpiredDateString()}</td>
					<td>${orgItem.alias}</td>
					<td>${orgItem.admin.name}</td>
					<td>${orgItem.admin.email}</td>
				</tr>
			</c:forEach>
		</table>
</form>
</div>